<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

  </head>
  <body>
  <g:if test="${upd=='si'}">
    <script>
      goTo('division','list','','definicion_list');
    </script>
  </g:if>
  <g:if test="${sendingEmail==1}">
    <script>
      closeLoading('loader')
    </script>
  </g:if>
  <div class="definicion">
    <div class="division">
${DefinicionUtils.buildHeaderShow_N_G('','division')}
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <g:if test="${listaErrores && listaErrores.size()>0}">
        <div class="errors">
          <ul>
            <g:each var="error" in="${listaErrores}">
              <li>${error}</li>
            </g:each>
          </ul></div>
      </g:if>
      <g:hasErrors bean="${divisionInstance}">
        <div class="errors">
          <g:renderErrors bean="${divisionInstance}" as="list" />
        </div>
      </g:hasErrors>
    </div>
    <g:form action="save" method="post" autocomplete="off" name="definicion">
      <input type="hidden" name="eOc" value="${eOc}"/>
      <input type="text" id="id" name="id" value="${divisionInstance.id}" disabled class="disabled" style="display: none;"/>
      <table width="400" align="center">
        <tbody>

          <tr class="prop">
            <td align="left" valign="middle" class="name"><label for="nombre">
                <g:message code="division.nombre.label" default="Nombre" />
              </label>            </td>
            <td valign="top" class="value ${hasErrors(bean: divisionInstance, field: 'nombre', 'errors')}">
        <g:textField name="nombre"  style="width:250px" class="campos" maxlength="50" value="${divisionInstance?.nombre}" />        </td>
        </tr>
        <tr class="prop">
          <td align="left" valign="middle" class="name"><label for="descripcion">
              <g:message code="division.descripcion.label" default="Descripci&oacute;n" />
            </label>          </td>
          <td valign="top" class="value ${hasErrors(bean: divisionInstance, field: 'descripcion', 'errors')}">
        <g:textArea name="descripcion" style="width:250px; height:70px; font-size:12px;" rows="3" cols="20" value="${divisionInstance?.descripcion}" class="campos" />        </td>
        </tr>
        <tr class="prop">
          <td align="left" valign="middle" class="name"><label for="especialidad">
              <g:message code="division.especialidad.label" default="Especialidad" />
            </label>          </td>
          <td valign="top" class="value ${hasErrors(bean: divisionInstance, field: 'especialidad', 'errors')}">
        <g:select name="especialidad" from="${sucre.Especialidad.list()}" class="campos" value="${divisionInstance?.especialidad?.id}" style="width:250px" optionKey="id" optionValue="nombre" />        </td>
        </tr>
        <tr class="prop">
          <td align="left" valign="middle" class="name">&nbsp;</td>
          <td valign="top" class="value ${hasErrors(bean: divisionInstance, field: 'especialidad', 'errors')}">&nbsp;</td>
        </tr>

        <tr class="prop">
          <td colspan="2" align="center" valign="top" class="value ${hasErrors(bean: divisionInstance, field: 'materias', 'errors')}">              
          <g:selectorMultiple listaA="${listaA}" listaB="${listaB}" titulo="Materias" nombre="materias"  style"height:150px;"/>          
        </td>
        </tr>
        </tbody>
      </table>
      <br/>
    </g:form>
  </div>
</body>
</html>